import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { LotequipmentregionVO, LotequipmentregionForm, LotequipmentregionQuery } from '@/api/access/parking-lot/parking-lot-equipment-region/types';

/**
 * 查询停车场-设备区域列表
 * @param query
 * @returns {*}
 */

export const listLotequipmentregion = (query?: LotequipmentregionQuery): AxiosPromise<LotequipmentregionVO[]> => {
  return request({
    url: '/parkinglot/lotEquipmentRegion/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询停车场-设备区域详细
 * @param parkingLotDeviceAccessPointsId
 */
export const getLotequipmentregion = (parkingLotDeviceAccessPointsId: string | number): AxiosPromise<LotequipmentregionVO> => {
  return request({
    url: '/parkinglot/lotEquipmentRegion/' + parkingLotDeviceAccessPointsId,
    method: 'get'
  });
};

/**
 * 新增停车场-设备区域
 * @param data
 */
export const addLotequipmentregion = (data: LotequipmentregionForm) => {
  return request({
    url: '/parkinglot/lotEquipmentRegion',
    method: 'post',
    data: data
  });
};

/**
 * 修改停车场-设备区域
 * @param data
 */
export const updateLotequipmentregion = (data: LotequipmentregionForm) => {
  return request({
    url: '/parkinglot/lotEquipmentRegion',
    method: 'put',
    data: data
  });
};

/**
 * 删除停车场-设备区域
 * @param parkingLotDeviceAccessPointsId
 */
export const delLotequipmentregion = (parkingLotDeviceAccessPointsId: string | number | Array<string | number>) => {
  return request({
    url: '/parkinglot/lotEquipmentRegion/' + parkingLotDeviceAccessPointsId,
    method: 'delete'
  });
};
/**
 * 同步-设备
 */
export const synchronization = (query?: LotequipmentregionQuery): AxiosPromise<LotequipmentregionVO[]> => {
  return request({
    url: '/parkinglot/lotEquipmentRegion/synchronization',
    method: 'get',
    params: query
  });
};
